﻿using System;   
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MenuUserControl
{
    public partial class LinksMenu : System.Web.UI.UserControl
    {
        private List<KeyValuePair<string, string>> links;
        private string font;

        public string Font
        {
            get { return font; }
            set { font = value; }
        }

        private string fontColor;

        public string FontColor
        {
            get { return fontColor; }
            set { fontColor = value; }
        }

        public List<KeyValuePair<string, string>> DataSource
        {
            get { return links; }
            set { links = value; }
        }

        public LinksMenu()
        {
            links = new List<KeyValuePair<string, string>>();
            font = "Times New Roman";
            fontColor = "#cc0000";
             
        }
        protected void Page_Load(object sender, EventArgs e)
        {
      
            mainDiv.InnerHtml = "<style type=\"text/css\">\n"
                +"a{\ntext-decoration:none;\n"
                +"color:"+fontColor+";\n"
                +"font-family:"+font+"}\n</style>";
                
            foreach (var link in links)
            {
                mainDiv.InnerHtml += "<div><a href=\""+link.Key+"\">" + link.Value + "</a></div>";
            }
           
        }


    }
}